/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package beans;

import doa.TwittererDAO;
import java.util.List;
import models.Twitterer;

/**
 *
 * @author Misja
 */
public class AuthorizationOverviewBean {

    private List<Twitterer> twitterers;

    public AuthorizationOverviewBean() {
        this.twitterers = TwittererDAO.getTwitterers();
    }

    public List<Twitterer> getTwitterers() {
        return twitterers;
    }

    public void setTwitterers(List<Twitterer> twitterers) {
        this.twitterers = twitterers;
    }

    public void changeRight(Twitterer twitterer) {
        if (twitterer.isCanPlace()) {
            twitterer.setCanPlace(false);
        } else {
            twitterer.setCanPlace(true);
        }
        TwittererDAO.updateTwitterer(twitterer);
    }
}
